package org.example.weboj.dto;

import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Pattern;
import java.util.List;

@Data
public class ProblemCreateRequest {
    
    @NotBlank(message = "题目标题不能为空")
    private String title;
    
    @NotBlank(message = "题目描述不能为空")
    private String description;
    
    @NotBlank(message = "难度等级不能为空")
    @Pattern(regexp = "Easy|Medium|Hard", message = "难度等级必须是Easy、Medium或Hard")
    private String difficulty;
    
    @NotNull(message = "时间限制不能为空")
    @Min(value = 100, message = "时间限制不能少于100毫秒")
    private Integer timeLimit; // in milliseconds
    
    @NotNull(message = "内存限制不能为空")
    @Min(value = 1, message = "内存限制不能少于1MB")
    private Integer memoryLimit; // in megabytes
    
    @NotNull(message = "测试用例不能为空")
    private List<TestCaseCreateRequest> testCases;
    
    @Data
    public static class TestCaseCreateRequest {
        @NotBlank(message = "测试用例输入不能为空")
        private String input;
        
        @NotBlank(message = "测试用例期望输出不能为空")
        private String expectedOutput;
        
        private Boolean isSample = false; // 是否为示例测试用例
    }
} 